(function($){


    $(function(){
        var nid = parent.getNid();
        $('.ok').click(function(){
            var index = parent.layer.getFrameIndex(window.name);
            var $name = $(this).parent().parent().find('.name').text();

            var url = '/business/financial/cashier?action=updateproduct',
                member_id = parent.getMember_id(),
                id = parent.getFid(),
                employee_id = $(this).parent().parent().find('[name="employee_id"]').val();

            $.post(
                url,
                {id: id, member_id: member_id,employee_id:employee_id},
                function(data){
                    if(data.status == 1) {
                        console.log('--------------------');
                        //location.reload(true);

                    } else {
                        parent.$('[data-nid="'+nid+'"]').html($name);
                        parent.layer.close(index);
                        layer.closeAll();

                    }
                },
                'json'
            )
        })

    });
})(jQuery)

